<template>
	<div class="layout-pd">
		<NoticeBar v-if="state.noticeStr" :text="state.noticeStr" leftIcon="basefont icon-tongzhi" background="#ecf5ff" color="#409eff" />
		<zh-row :gutter="10" style="margin-top: 10px">
			<zh-col :md="24" :lg="6" :xl="6">
				<zh-card>
					<Banner bannerType="index"></Banner>
					<div style="margin-top: 10px">
						<Bulletin></Bulletin>
					</div>
				</zh-card>
			</zh-col>
			<zh-col :md="24" :lg="12" :xl="12">
				<zh-row :gutter="10"> </zh-row>
				<zh-card title="快捷入口"> </zh-card>
			</zh-col>
			<zh-col :md="24" :lg="6" :xl="6">
				<zh-card body-style="padding:0px;">
					<Personal />
					<a-config-provider :locale="zhCN">
						<a-calendar :fullscreen="false" />
					</a-config-provider>
					<zh-card title="我的日程">
					</zh-card>
				</zh-card>
			</zh-col>
		</zh-row>
	</div>
</template>

<script lang="ts" setup name="stagingPage">
import zhCN from 'ant-design-vue/es/locale/zh_CN';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
dayjs.locale('zh-cn');
// 引入组件
const NoticeBar = defineAsyncComponent(() => import('@/components/noticeBar/index.vue')); //滚动通知组件
const Banner = defineAsyncComponent(() => import('@/views/overview/component/banner/index.vue')); //轮播图组件
const Bulletin = defineAsyncComponent(() => import('@/views/overview/component/bulletin/index.vue')); //轮播图组件
const Personal = defineAsyncComponent(() => import('@/views/overview/component/personal/index.vue')); //个人信息
const VITE_APP_ID = import.meta.env.VITE_APP_ID as string;
//------------------接收传入参数(组件)-------------------
const state = reactive({
	noticeList: [],
	noticeStr: '暂无',
	locale: zhCN,
});

//------------------定义子组件---------------------------

//------------------内部变量定义-------------------------

//------------------定义调用方法-------------------------
const getNoticeList = () => {
	//获取系统状态通知
	let params: any = { appId: VITE_APP_ID,userType: $store.user.userType};
	$api.common.send.post('sysNotice0011', params).then((res: any) => {
		state.noticeList = res.result;
		if (res.result && res.result.length > 0) {
			let str = '';
			res.result.forEach((element) => {
				if (str) {
					str = str + ',' + element.title;
				} else {
					str = element.title;
				}
			});
			state.noticeStr = str;
		}
	});
};
//-------------------------初始化-----------------------------
onMounted(() => {
	nextTick(() => {
		getNoticeList();
	});
});
</script>
<style scoped lang="scss"></style>
